package com.xjscrm.console.mapper;

import com.xjscrm.console.dto.chat.ChatWordsLibraryGroupQueryDTO;
import com.xjscrm.console.entity.ChatWordsLibraryGroup;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author mingyang.chen create in 2024/3/15 14:51
 */
@Mapper
public interface ChatWordsLibraryGroupMapper extends CommonMapper<ChatWordsLibraryGroup> {
    int deleteByPrimaryKey(Long id);

    int insertSelective(ChatWordsLibraryGroup record);

    ChatWordsLibraryGroup selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ChatWordsLibraryGroup record);

    List<ChatWordsLibraryGroup> query(@Param("merId") Long merId, @Param("staffId") Long id, @Param("query") ChatWordsLibraryGroupQueryDTO query);

    Integer selectMaxSort(@Param("merId") Long merId, @Param("staffId") Long staffId);

    List<ChatWordsLibraryGroup> selectByIds(@Param("merId") Long merId, @Param("ids") List<Long> groupIds);

    ChatWordsLibraryGroup selectById(@Param("merId") Long merId, @Param("id") Long groupId);

    ChatWordsLibraryGroup selectByNameAndType(@Param("merId") Long merId, @Param("type") Integer type,
                                              @Param("groupName") String groupName, @Param("staffId") Long staffId);
}